<?php
include('header.php');
if(!isset($data['login'])){
echo "<script>document.location.href='index.php'</script>";
exit;
}

?>
<div class="block medium right">
			<div class="top">	
                  <h1>Coin Transfer History</h1>
            </div>
			<div class="content">
		
	


<?



$result = mysql_query("SELECT * FROM  `trans` WHERE `to` = '{$data['login']}' || `from` = '{$data['login']}' order by date desc ") or die(mysql_error());  

$returned_rows = mysql_num_rows ($result);

if ($returned_rows<='0'){ echo "No Transfer activity<BR><BR>";}else{



echo "<center><font size=4>";


// keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {

	// Print out the contents of each row into a table

if ($row['to']==$data['login']){
echo $row['date'];
echo " You got ";
echo $row['coins'];
echo " coins from ";
echo $row['from'];
echo "<BR><BR>";


}

if ($row['from']==$data['login']){
echo $row['date'];
echo " You sent ";
echo $row['coins'];
echo " coins to ";
echo $row['to'];
echo "<BR><BR>";


}





echo "";
}

?>

<BR><BR>
<? } ?>

</font>
<BR><BR>








</div>

</div>

<?include('footer.php');?>